#!/usr/bin python3
# -*- coding:UTF-8 -*-
# Author: nigo
import pandas as pd
from sqlalchemy import create_engine
import pymysql

# 使用sqlalchemy创建connect
# connect = create_engine(
#     'mysql+pymysql://nigo:1234@localhost:3306/learn?charset=utf8')

# 使用pymysql创建connect
connect = pymysql.connect(host='127.0.0.1',
                          db='learn',
                          user='nigo',
                          passwd='1234',
                          charset='utf8')
sql = 'select * from ecommerce limit 5'
df = pd.read_sql(sql, connect)
print(df)
